<div class="contactfrom">

<form class="std " action="#" method="POST">
<fieldset class="">
        <div class="text">
			<label for="name"><?php echo $var_portal_yourname; ?></label>
			<?php formText($portletUID."name",0,"account_input"); ?>
		</div>
		<div class="text">
			<label for="mail"><?php echo $var_portal_yourmail; ?></label>
			<?php formText($portletUID."mail",0,"account_input"); ?>
		</div>
		<div class="text">
			<label for="subject"><?php echo $var_portal_Subject; ?></label>
			<?php formText($portletUID."subject",0,"account_input"); ?>
		</div>
		
		<div class="textarea">
			<label for="message"><?php echo $var_portal_Yourmessage; ?></label>
			</textarea><?php formTextArea($portletUID."message",20,10,"account_input"); ?>
		</div>
		
		<div class="captcha"> <div><div style="position: relative;">
<img src="/php/captcha/captcha.php" id="<?php echo $portletUID; ?>captcha_img" /><br/>



<!-- CHANGE TEXT LINK -->
<a  onclick="javascript:reloadCaptcha('<?php echo $portletUID; ?>captcha_img');"
    id="change-image"><?php echo $var_portal_Notseenable; ?></a><br/>

                <?php formError($portletUID."captcha")?>

<input type="text" name="<?php echo $portletUID; ?>captcha" id="<?php echo $portletUID; ?>captcha" /></div>
        </div></div>
	<input type="submit" class="button"  value="<?php echo $var_portal_Send; ?>"  name="<?php echo $portletUID?>sendMail">

	</fieldset>
		<br/>
</form>






</div>
<?php


if (getParameter($portletUID."sendMail"))
{
	
	$error=false;
	
	
	/** Validate captcha */
	
	if (isset($_REQUEST[$portletUID.'captcha'])) {
		if (trim(strtolower(getParameter($portletUID."captcha"))) != $_SESSION['captcha']) {
			displayError($var_portal_invalidcaptcha,$portletUID."captcha");
			// $error=false;
		}
	}
	
	$mail=getParameter($portletUID."mail");
	$name=getParameter($portletUID."name");
	$subject=getParameter($portletUID."subject");
	$message=getParameter($portletUID."message");
	if ($mail==null || ew_CheckEmail($mail)==FALSE) displayError($var_portal_invalidmail,$portletUID."mail");
	if ($name==null) displayError($var_portal_invalidname, $portletUID."name");
	if ($subject==null) displayError($var_portal_invalidsubject, $portletUID."subject");
	if ($message==null) displayError($var_portal_invalidmessage, $portletUID."message");
	
	
	if (!$error){


		 $data=array();
        $data["subject"]=$subject;
        $data["name"]=$name;
        $data["mail"]=$mail;
        $data["message"]=$message;
		sendMailToAdmins($portalId, TemplateWithData($var_portal_mail_contact,$data));
	ShowSuccess($var_portal_contact_confirm);
	}
}


?>